:root {
    --bg: #050505;
    --bg-2: #0c0c0c;
    --bg-3: #121212;
    --fg: #f3f3f3;
    --muted: #8d8d8d;
    --line: #222;
    --line-strong: #ececec;
    --danger: #fff;
    --font: "Manrope", "Segoe UI", sans-serif;
    --display: "Cormorant Garamond", Georgia, serif;
    --wrap: 1120px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

img,
video {
    max-width: 100%;
}

button,
input,
textarea {
    font: inherit;
    color: inherit;
}

.wrap {
    width: min(var(--wrap), calc(100% - 40px));
    margin-inline: auto;
}

.logo {
    font-family: var(--display);
    font-weight: 700;
    letter-spacing: 0.42em;
    text-transform: uppercase;
    font-size: 1.15rem;
}

.site-header {
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(5, 5, 5, 0.92);
    backdrop-filter: blur(12px);
}

.header-inner,
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    gap: 24px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 22px;
    font-size: 0.82rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.nav a:hover {
    color: #fff;
}

.nav-tag {
    border: 1px solid var(--line-strong);
    padding: 2px 8px;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
}

.site-main {
    min-height: calc(100vh - 160px);
    padding: 48px 0 80px;
}

.is-admin .site-main {
    padding: 0;
    min-height: 100vh;
}

.hero {
    padding-bottom: 48px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 36px;
}

.eyebrow {
    margin: 0 0 12px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    font-size: 0.72rem;
    color: var(--muted);
}

.hero h1,
.watch-head h1,
.admin-head h1,
.login-card h1,
.age-gate h1 {
    font-family: var(--display);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
}

.hero h1 {
    font-size: clamp(2.4rem, 6vw, 4.6rem);
    line-height: 0.95;
    max-width: 14ch;
}

.hero-lead {
    max-width: 42ch;
    color: var(--muted);
    margin: 18px 0 0;
}

.grid-meta {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.video-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.video-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    background: var(--bg-2);
    min-height: 100%;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.video-card:hover {
    border-color: var(--line-strong);
    transform: translateY(-2px);
}

.card-stage {
    aspect-ratio: 16 / 10;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 40%),
        repeating-linear-gradient(
            -45deg,
            #0a0a0a 0 10px,
            #0e0e0e 10px 20px
        );
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.card-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-index,
.play-mark,
.card-hint {
    z-index: 1;
}

.card-index {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    color: var(--muted);
}

.play-mark {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 11px 0 11px 18px;
    border-color: transparent transparent transparent #fff;
    margin-left: 4px;
}

.card-hint {
    position: absolute;
    bottom: 12px;
    right: 12px;
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

.card-body {
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card-title {
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    color: var(--muted);
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.pager-status {
    color: var(--muted);
    letter-spacing: 0.16em;
    font-size: 0.8rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--fg);
    cursor: pointer;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.74rem;
    font-weight: 600;
}

.btn-solid {
    background: #fff;
    color: #000;
    border-color: #fff;
}

.btn-ghost {
    border-color: var(--line);
}

.btn-danger {
    border-color: #fff;
    color: #fff;
}

.btn-block {
    width: 100%;
}

.btn:hover:not(.is-disabled) {
    opacity: 0.82;
}

.btn.is-disabled {
    opacity: 0.28;
    pointer-events: none;
}

.empty {
    min-height: 40vh;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 18px;
    text-align: center;
    color: var(--muted);
}

.site-footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.82rem;
}

.footer-inner {
    min-height: 88px;
    align-items: flex-start;
    padding: 22px 0;
    flex-direction: column;
}

.legal-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.72rem;
}

.legal-nav a:hover {
    color: #fff;
}

.legal {
    max-width: 760px;
    display: grid;
    gap: 8px;
}

.legal h1 {
    font-family: var(--display);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 600;
    margin: 8px 0 0;
}

.legal h2 {
    font-family: var(--display);
    font-size: 1.45rem;
    font-weight: 600;
    margin: 22px 0 6px;
}

.legal-lead {
    color: var(--muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.75rem;
    margin: 0 0 18px;
}

.legal p,
.legal li,
.legal address {
    color: #cfcfcf;
    font-style: normal;
    line-height: 1.65;
}

.legal ul,
.legal ol {
    margin: 0;
    padding-left: 1.2rem;
}

.legal a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.watch {
    display: grid;
    gap: 22px;
}

.back-link {
    color: var(--muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.player-shell {
    position: relative;
    width: min(100%, 640px);
    max-width: 640px;
    margin-inline: auto;
    aspect-ratio: 16 / 9;
    max-height: 360px;
    height: auto;
    background: #000;
    overflow: hidden;
}

.player-shell .fluid_video_wrapper {
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

.player-shell video,
.player-shell .fluid_video_wrapper video {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain;
    display: block;
    background: #000;
}

.watch-head h1 {
    font-size: clamp(1.8rem, 4vw, 3rem);
}

.watch-meta {
    display: flex;
    gap: 18px;
    color: var(--muted);
    font-size: 0.9rem;
}

.watch-desc {
    max-width: 62ch;
    color: #cfcfcf;
}

.related h2 {
    font-family: var(--display);
    font-size: 1.6rem;
    font-weight: 600;
    margin: 12px 0 10px;
}

.related-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--line);
}

.related-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.related-thumb {
    width: 96px;
    height: 54px;
    object-fit: cover;
    background: #000;
    flex-shrink: 0;
}

.related-list a:hover .related-title {
    text-decoration: underline;
}

.related-views {
    color: var(--muted);
    white-space: nowrap;
}

.age-body,
.login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.age-gate,
.login-card {
    width: min(440px, 100%);
    text-align: center;
}

.age-logo,
.login-logo {
    margin: 0 0 28px;
}

.age-gate h1,
.login-card h1 {
    font-size: 2.6rem;
}

.age-copy,
.login-sub {
    color: var(--muted);
}

.age-actions {
    display: grid;
    gap: 10px;
    margin-top: 28px;
}

.login-card {
    text-align: left;
    border: 1px solid var(--line);
    background: var(--bg-2);
    padding: 32px 28px;
}

.login-card h1,
.login-logo {
    text-align: center;
}

.login-sub {
    text-align: center;
    margin-top: 8px;
}

.login-card label,
.upload-form label {
    display: grid;
    gap: 8px;
    margin: 16px 0;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.login-card input,
.upload-form input,
.upload-form textarea {
    width: 100%;
    background: #000;
    border: 1px solid var(--line);
    padding: 12px 12px;
    text-transform: none;
    letter-spacing: 0;
    color: var(--fg);
}

.login-card input:focus,
.upload-form input:focus,
.upload-form textarea:focus {
    outline: 1px solid #fff;
}

.login-back {
    display: block;
    text-align: center;
    margin-top: 18px;
    color: var(--muted);
    font-size: 0.85rem;
}

.alert {
    border: 1px solid var(--line-strong);
    padding: 10px 12px;
    font-size: 0.9rem;
}

.alert-error {
    border-style: dashed;
}

.admin-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

.admin-side {
    border-right: 1px solid var(--line);
    padding: 28px 22px;
    background: var(--bg-2);
}

.side-label {
    color: var(--muted);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-size: 0.68rem;
    margin: 28px 0 12px;
}

.admin-side nav {
    display: grid;
    gap: 8px;
}

.admin-side nav a {
    padding: 8px 0;
    color: var(--muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.admin-side nav a.is-active,
.admin-side nav a:hover {
    color: #fff;
}

.admin-main {
    padding: 32px 40px 64px;
}

.admin-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 28px;
}

.admin-head-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.admin-head p {
    margin: 8px 0 0;
    color: var(--muted);
}

.stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 280px));
    gap: 14px;
    margin: 18px 0 28px;
}

.stats article {
    border: 1px solid var(--line);
    padding: 18px 16px;
    background: var(--bg-2);
}

.stats span {
    display: block;
    color: var(--muted);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 0.7rem;
}

.stats strong {
    display: block;
    margin-top: 8px;
    font-family: var(--display);
    font-size: 2.4rem;
    font-weight: 600;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.admin-table th {
    color: var(--muted);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 600;
}

.admin-table tr:last-child td {
    border-bottom: 0;
}

.table-title:hover {
    text-decoration: underline;
}

.num {
    font-variant-numeric: tabular-nums;
}

.actions {
    text-align: right;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-empty {
    min-height: 30vh;
}

.upload-form {
    max-width: 560px;
}

.file-label small {
    text-transform: none;
    letter-spacing: 0;
    color: var(--muted);
}

.upload-status {
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.85rem;
    letter-spacing: 0;
    text-transform: none;
}

.upload-bar {
    margin-top: 10px;
    height: 4px;
    background: var(--line);
}

.upload-bar span {
    display: block;
    width: 0;
    height: 100%;
    background: #fff;
}

@media (max-width: 980px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-side {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .admin-main {
        padding: 24px 18px 48px;
    }
}

@media (max-width: 640px) {
    .video-grid {
        grid-template-columns: 1fr;
    }

    .header-inner {
        min-height: 64px;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .site-main {
        padding-top: 32px;
    }
}

/* App (Android WebView): compact mobile layout, not a stretched website */
body.is-app {
    font-size: 14px;
}

body.is-app .wrap {
    width: 100%;
    max-width: 100%;
    padding-inline: 10px;
}

body.is-app .site-header {
    position: sticky;
    top: 0;
}

body.is-app .header-inner {
    min-height: 48px;
    gap: 12px;
}

body.is-app .logo {
    font-size: 0.95rem;
    letter-spacing: 0.28em;
}

body.is-app .nav {
    gap: 10px;
    font-size: 0.7rem;
}

body.is-app .nav-tag {
    padding: 1px 6px;
    font-size: 0.62rem;
}

body.is-app .site-main {
    min-height: calc(100vh - 120px);
    padding: 10px 0 20px;
}

body.is-app .grid-meta {
    font-size: 0.68rem;
    margin-bottom: 10px;
}

body.is-app .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

body.is-app .video-card {
    border-radius: 6px;
    overflow: hidden;
}

body.is-app .video-card:hover {
    transform: none;
}

body.is-app .card-stage {
    aspect-ratio: 16 / 9;
}

body.is-app .card-index,
body.is-app .play-mark,
body.is-app .card-hint {
    display: none;
}

body.is-app .card-body {
    padding: 7px 8px 8px;
}

body.is-app .card-meta {
    font-size: 0.68rem;
    gap: 6px;
}

body.is-app .pager {
    margin-top: 16px;
    padding-top: 12px;
    gap: 8px;
}

body.is-app .btn {
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.68rem;
}

body.is-app .back-link {
    display: none;
}

body.is-app .watch {
    gap: 12px;
}

body.is-app .player-shell {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    max-height: 42vh !important;
    margin: 0 auto !important;
    border-radius: 6px;
}

body.is-app .watch-head h1 {
    font-size: 1.05rem;
}

body.is-app .watch-meta {
    font-size: 0.75rem;
    gap: 10px;
}

body.is-app .watch-desc {
    font-size: 0.85rem;
}

body.is-app .related h2 {
    font-family: var(--font);
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin: 4px 0 8px;
}

body.is-app .related-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    border-top: 0;
}

body.is-app .related-list a {
    display: block;
    padding: 0;
    border-bottom: 0;
}

body.is-app .related-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    display: block;
    border-radius: 6px;
}

body.is-app .related-title,
body.is-app .related-views {
    display: block;
    font-size: 0.68rem;
    padding: 5px 2px 0;
}

body.is-app .site-footer {
    font-size: 0.68rem;
}

body.is-app .footer-inner {
    min-height: 0;
    padding: 12px 0;
    gap: 8px;
}

body.is-app .footer-inner > p {
    display: none;
}

body.is-app .legal-nav {
    gap: 8px 12px;
    font-size: 0.62rem;
}

body.age-body.is-app {
    padding: 20px 16px;
}

body.age-body.is-app .age-gate h1 {
    font-size: 1.6rem;
}

body.age-body.is-app .age-logo {
    margin-bottom: 16px;
    font-size: 1rem;
}

body.age-body.is-app .age-copy {
    font-size: 0.9rem;
}

body.age-body.is-app .age-actions {
    margin-top: 18px;
}
