:root {
    color-scheme: dark;
    --bg: #090e1b;
    --panel: #131d30;
    --border: #263650;
    --text: #f1f6ff;
    --muted: #9badc5;
    --accent: #5778ff;
    --accent2: #9d6dff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 82% -20%, #000 0%, transparent 38%),
        var(--bg);
    font-family: Inter, system-ui, Arial, sans-serif;
    color: var(--text);
}

.wrap {
    max-width: 1200px;
    margin: auto;
    padding: 0 22px;
}

.top {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #0a1222ef;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 76px;
}

.brand {
    white-space: nowrap;
    font-weight: 900;
    letter-spacing: 1px;
    font-size: 21px;
    color: var(--text);
    text-decoration: none;
}

.brand span:not(.logo) {
    color: #7990ff;
}

.logo {
    display: inline-grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-radius: 11px;
    color: white;
    width: 34px;
    height: 34px;
    margin-right: 6px;
}

.search {
    display: flex;
    flex: 1;
    max-width: 530px;
    margin: auto;
    border: 1px solid var(--border);
    border-radius: 13px;
    overflow: hidden;
    background: #101a2d;
}

.search input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: 0;
    padding: 12px 15px;
    color: white;
    outline: 0;
}

.search button {
    border: 0;
    color: white;
    background: #344a90;
    padding: 0 19px;
    cursor: pointer;
}

.admin-link {
    color: #c6d0e5;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
}

.hero {
    background: linear-gradient(113deg, #1b315c, #26173f 95%);
    border: 1px solid #39477d;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-radius: 24px;
    padding: 62px 7%;
    margin: 42px 0 39px;
}

.eyebrow {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #a4b4ff;
}

.hero h1 {
    font-size: clamp(33px, 4.5vw, 62px);
    letter-spacing: -2px;
    line-height: 1.12;
    margin: 12px 0;
}

.hero em {
    font-style: normal;
    color: #a3aaff;
}

.hero p,
.admin-heading p,
.auth p {
    color: #b9c9e4;
}

.hero-mark {
    align-self: center;
    display: grid;
    place-items: center;
    background: #ffffff12;
    border: 2px solid #ffffff22;
    border-radius: 45px;
    width: 150px;
    height: 150px;
    font-size: 70px;
    color: #b6a6ff;
    flex-shrink: 0;
}
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-head h2 {
    margin: 0;
    font-size: 25px;
}

.section-head p {
    color: var(--muted);
    margin: 6px 0;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    margin-bottom: 70px;
}

.video-card {
    display: block;
    width: 100%;
    min-width: 0;
    color: inherit;
    text-decoration: none;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    transition: transform .2s, border-color .2s;
}

.video-card:hover {
    transform: translateY(-4px);
    border-color: #5c73d3;
}

.video-card .poster {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
}

.video-card .poster img,
.video-card .poster video {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: #000;
}

.video-card .poster.landscape,
.video-card .poster.portrait,
.video-card .poster.square {
    aspect-ratio: 16 / 9;
}

.no-thumb {
    display: grid;
    place-items: center;
    font-size: 56px;
    width: 100%;
    height: 100%;
    color: #c3caff;
}

.play {
    position: absolute;
    z-index: 3;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border-radius: 100%;
    background: #071324ad;
    display: grid;
    place-items: center;
    opacity: .9;
}

.video-info {
    padding: 18px;
}

.category {
    color: #b2beff;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.video-info h3 {
    margin: 9px 0;
    font-size: 17px;
    line-height: 1.4;
}

.video-info p,
.muted {
    color: var(--muted);
    font-size: 14px;
}

.video-views {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    margin: 8px 0;
    border-radius: 8px;
    background: rgba(255,255,255,.08);
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 500;
}

.empty {
    text-align: center;
    background: var(--panel);
    padding: 70px 22px;
    border-radius: 20px;
    margin-bottom: 60px;
    color: var(--muted);
}

.empty span {
    font-size: 70px;
}

.empty h3 {
    color: white;
}

.footer {
    border-top: 1px solid var(--border);
    color: #889ab6;
    margin-top: 80px;
}

.footer > .wrap {
    display: flex;
    justify-content: space-between;
    padding-top: 22px;
    padding-bottom: 22px;
    font-size: 13px;
}

.alerts {
    margin-top: 18px;
}

.alerts:empty {
    display: none;
}

.success,
.error {
    padding: 15px 18px;
    border-radius: 12px;
}

.success {
    background: #123d38;
    color: #adf6d2;
}

.error {
    background: #5f212a;
    color: #ffd5d5;
}

.watch-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 35px;
    margin-top: 33px;
}

.back {
    display: inline-block;
    margin-bottom: 18px;
    color: #b8c7ea;
    text-decoration: none;
}

.player {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 18px;
    margin-bottom: 25px;
}

.watch-layout h1 {
    font-size: 32px;
    line-height: 1.2;
    margin: 13px 0 9px;
}

.description {
    padding: 22px 0;
    border-top: 1px solid var(--border);
    line-height: 1.8;
    white-space: normal;
    margin-top: 22px;
    overflow-wrap: anywhere;
}

.watch-layout aside {
    padding-top: 28px;
}

.related {
    display: flex;
    gap: 13px;
    text-decoration: none;
    color: inherit;
    margin: 20px 0;
}

.related-thumb {
    background: #1c315d;
    width: 114px;
    aspect-ratio: 16 / 9;
    border-radius: 9px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related strong {
    font-size: 13px;
    display: block;
    line-height: 1.45;
}

.related small {
    display: block;
    color: var(--muted);
    margin-top: 6px;
}

.auth {
    max-width: 475px;
    margin: 70px auto 100px;
    padding: 32px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 22px;
}

.auth h1 {
    margin-bottom: 8px;
}

.auth form,
.panel form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 23px;
}

label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

label input,
label textarea {
    display: block;
    background: #0b1425;
    border: 1px solid #3a4760;
    color: #fff;
    border-radius: 10px;
    padding: 13px 12px;
    font: inherit;
    width: 100%;
    outline: 0;
}

input:focus,
textarea:focus {
    border-color: #8a94ff;
}

.btn {
    background: linear-gradient(120deg, var(--accent), #755df9);
    border: 0;
    border-radius: 10px;
    color: white;
    display: inline-block;
    font-weight: 750;
    padding: 13px 18px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.btn.ghost {
    background: #172641;
    border: 1px solid #3a4b75;
}

.admin-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
}

.admin-heading h1 {
    margin: 8px 0;
}

.stat {
    display: flex;
    flex-direction: column;
    padding: 22px 28px;
    background: linear-gradient(100deg, #273d74, #22224a);
    border: 1px solid #3e4c82;
    border-radius: 16px;
    max-width: 280px;
    margin: 24px 0;
}

.stat strong {
    font-size: 40px;
    margin: 10px 0;
}

.stat small {
    color: #c7d1ff;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 23px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 28px;
    min-width: 0;
}

.panel h2 {
    margin: 0;
}

.panel form .muted {
    margin-top: -12px;
}

.manage-row {
    display: flex;
    gap: 13px;
    padding: 17px 0;
    border-bottom: 1px solid var(--border);
}

.manage-thumb {
    width: 85px;
    min-width: 85px;
    aspect-ratio: 16 / 9;
    align-self: start;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: #314273;
    overflow: hidden;
}

.manage-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.manage-text {
    min-width: 0;
}

.manage-text strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: 15px;
}

.manage-text small {
    display: block;
    color: var(--muted);
    margin: 6px 0;
}

.manage-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.manage-actions a {
    font-size: 13px;
    color: #a5b7ff;
    text-decoration: none;
}

.manage-actions form {
    margin: 0;
}

.danger {
    color: #ff9494;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
}

.welcome-popup[hidden],
#welcomePopup[hidden] {
    display: none !important;
}

.welcome-popup,
#welcomePopup {
    position: fixed;
    inset: 0;
    z-index: 999999;
    width: 100%;
    height: 100dvh;
    background: rgba(0,0,0,.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.popup-box,
#welcomePopup .popup-box {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 90dvh;
    overflow-y: auto;
    padding: 25px;
    border-radius: 18px;
    background: #131d30;
    border: 1px solid #344a90;
    color: #fff;
    text-align: center;
    box-shadow: 0 20px 70px rgba(0,0,0,.7);
}

.popup-box h2 {
    margin: 0 0 12px;
    color: #fff;
    font-size: 24px;
}

.popup-box p {
    color: #cbd5e1;
    line-height: 1.5;
}

.popup-image,
#welcomePopup .popup-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 260px;
    object-fit: contain;
    border-radius: 12px;
    margin: 12px auto;
}

.popup-close,
#welcomePopup .popup-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    border: 0;
    background: #263650;
    color: white;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
}

.popup-button {
    display: block;
    padding: 13px;
    margin-top: 12px;
    border-radius: 10px;
    background: #5778ff;
    color: white;
    text-decoration: none;
    font-weight: 700;
}

.popup-skip {
    margin-top: 12px;
    padding: 10px;
    border: 0;
    background: transparent;
    color: #cbd5e1;
    cursor: pointer;
}

.website-description {
    width: 100%;
    max-width: 1200px;
    margin: 45px auto 20px;
    padding: 25px 22px;
    color: #e2e8f0;
    background: transparent;
}

.description-container {
    border-top: 1px solid var(--border);
    padding-top: 25px;
}

.website-description h2 {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 15px;
    line-height: 1.4;
}

.website-description p {
    font-size: 15px;
    line-height: 1.8;
    margin: 0 0 18px;
    color: #cbd5e1;
}

.website-description ul {
    padding-left: 20px;
    margin: 15px 0 25px;
}

.website-description ul li {
    font-size: 14px;
    line-height: 1.9;
    margin-bottom: 5px;
    color: #dbeafe;
}

.website-description .description-copyright {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 25px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    max-width: 600px;
    margin: 25px auto;
    padding: 10px;
    background: #101827;
    border: 1px solid #26354b;
    border-radius: 12px;
    box-sizing: border-box;
}

.page-btn {
    flex: 1;
    min-width: 0;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #192438;
    border: 1px solid #34445d;
    border-radius: 9px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background .2s ease, border-color .2s ease;
}

.page-btn:hover {
    background: #243550;
    border-color: #5876a5;
}

.page-btn.next {
    background: #294b91;
    border-color: #3c61ad;
    color: #fff;
}

.page-btn.next:hover {
    background: #355da9;
}

.page-btn.disabled {
    background: #131c2b;
    color: #66748a;
    border-color: #273348;
    opacity: .45;
    cursor: not-allowed;
}

.page-jump {
    flex: 1.2;
    min-width: 0;
}

.page-jump select {
    width: 100%;
    height: 46px;
    padding: 0 8px;
    background: #192438;
    border: 1px solid #3b5275;
    border-radius: 9px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    outline: none;
    cursor: pointer;
}

.page-jump select:focus {
    border-color: #6d91cc;
}

.page-jump select option {
    background: #192438;
    color: #fff;
}

.pagination-info {
    margin: 12px 0 25px;
    color: #8998ad;
    font-size: 12px;
    text-align: center;
}

html body a#telegram-float {
    position: fixed !important;
    right: 20px !important;
    bottom: 20px !important;
    left: auto !important;
    top: auto !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;

    width: max-content !important;
    max-width: calc(100vw - 30px) !important;
    height: auto !important;

    padding: 12px 18px !important;
    box-sizing: border-box !important;

    background: linear-gradient(
        135deg,
        #131d30,
        #202d55,
        #261b45
    ) !important;

    border: 1px solid #5778ff !important;
    border-radius: 50px !important;

    color: #fff !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    letter-spacing: .5px !important;
    text-decoration: none !important;
    white-space: nowrap !important;

    box-shadow:
        0 0 8px rgba(87,120,255,.7),
        0 0 20px rgba(87,120,255,.4),
        0 0 35px rgba(157,109,255,.3) !important;

    z-index: 9999999 !important;
    transition: all .3s ease !important;
}

html body a#telegram-float img {
    display: block !important;
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
    min-width: 32px !important;
    object-fit: contain !important;
    flex: 0 0 32px !important;
}

html body a#telegram-float span {
    display: inline-block !important;
    color: #fff !important;
    white-space: nowrap !important;
}

html body a#telegram-float .telegram-arrow {
    color: #a3aaff !important;
    font-size: 19px !important;
}

html body a#telegram-float:hover {
    background: linear-gradient(
        135deg,
        #5778ff,
        #9d6dff
    ) !important;

    border-color: #b7a2ff !important;
    color: #fff !important;

    transform: translateY(-4px) !important;

    box-shadow:
        0 0 12px rgba(87,120,255,.9),
        0 0 28px rgba(157,109,255,.7) !important;
}

html body a#telegram-float:hover .telegram-arrow {
    color: #fff !important;
}

@media (max-width: 900px) {
    .cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }

    .watch-layout,
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .watch-layout aside {
        padding-top: 0;
    }
}

@media (max-width: 620px) {
    .nav {
        gap: 11px;
        flex-wrap: wrap;
        padding-top: 15px;
        padding-bottom: 15px;
    }

    .search {
        order: 3;
        width: 100%;
        max-width: none;
        flex-basis: 100%;
    }

    .brand {
        font-size: 17px;
    }

    .admin-link {
        margin-left: auto;
        font-size: 12px;
    }

    .hero {
        padding: 36px 25px;
        margin-top: 25px;
    }

    .hero-mark {
        display: none;
    }

    .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .video-card {
        border-radius: 12px;
    }

    .video-info {
        padding: 9px;
    }

    .video-info h3 {
        font-size: 12px;
        line-height: 1.4;
        overflow-wrap: anywhere;
    }

    .video-info p {
        font-size: 10px;
    }

    .category {
        font-size: 10px;
    }

    .video-views {
        font-size: 10px;
        padding: 5px 7px;
    }

    .video-card .btn {
        width: 100%;
        font-size: 10px;
        padding: 9px 5px;
        white-space: normal;
    }

    .video-card .play {
        width: 32px;
        height: 32px;
    }

    .admin-heading {
        align-items: flex-start;
        gap: 8px;
    }

    .admin-heading h1 {
        font-size: 24px;
    }

    .footer > .wrap {
        flex-wrap: wrap;
        gap: 8px;
    }

    .panel {
        padding: 19px;
    }

    .popup-box,
    #welcomePopup .popup-box {
        max-width: 350px;
        padding: 18px;
    }

    .popup-box h2 {
        font-size: 21px;
    }

    .website-description {
        padding: 20px 15px;
        margin-top: 30px;
    }

    .website-description h2 {
        font-size: 18px;
    }

    .website-description p {
        font-size: 14px;
        line-height: 1.7;
    }

    .website-description ul li {
        font-size: 13px;
    }

    .pagination {
        gap: 7px;
        padding: 8px;
        margin-top: 22px;
    }

    .page-btn,
    .page-jump select {
        height: 44px;
        font-size: 12px;
        border-radius: 8px;
    }

    .pagination-info {
        font-size: 11px;
    }

    html body a#telegram-float {
        right: 12px !important;
        bottom: 15px !important;
        padding: 10px 14px !important;
        gap: 8px !important;
        font-size: 11px !important;
    }

    html body a#telegram-float img {
        width: 30px !important;
        height: 30px !important;
        max-width: 30px !important;
        min-width: 30px !important;
        flex-basis: 30px !important;
    }
}

@media (max-width: 480px) {
    .page-btn,
    .page-jump select {
        height: 44px;
        font-size: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .page-btn,
    .video-card,
    #telegram-float {
        transition: none !important;
    }
}
body {
    outline: 5px solid red !important;
}
