* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: #eff8ff;
    background:
        linear-gradient(180deg, rgba(4, 9, 16, .55), rgba(4, 9, 16, .94)),
        url("assets/logo-mega-peli.png") center top / min(1180px, 120vw) auto no-repeat,
        #03070d;
}

a {
    color: inherit;
}

.peli-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px clamp(14px, 3vw, 34px);
    border-bottom: 1px solid rgba(52, 210, 255, .22);
    background: rgba(3, 7, 13, .86);
    backdrop-filter: blur(14px);
}

.peli-brand {
    display: inline-flex;
    align-items: center;
    width: 190px;
    max-width: 42vw;
}

.peli-brand img {
    width: 100%;
    height: 54px;
    object-fit: contain;
}

.peli-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.peli-nav a,
button,
.panel-title a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 13px;
    border: 1px solid rgba(52, 210, 255, .35);
    border-radius: 999px;
    background: rgba(6, 21, 32, .72);
    color: #eafaff;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.peli-nav a:hover,
button:hover,
.panel-title a:hover {
    background: #19c8ff;
    color: #04101a;
}

.peli-hero {
    min-height: 330px;
    display: flex;
    align-items: flex-end;
    padding: 120px clamp(16px, 4vw, 44px) 26px;
}

.hero-copy h1 {
    margin: 0;
    font-size: clamp(42px, 8vw, 96px);
    line-height: .9;
    letter-spacing: 0;
    text-shadow: 0 0 18px rgba(25, 200, 255, .75);
}

.hero-copy p {
    width: min(620px, 100%);
    margin: 12px 0 0;
    color: #c8e8f5;
    font-size: 18px;
    line-height: 1.4;
}

.watch-layout,
.content-grid {
    width: min(1440px, calc(100% - 28px));
    margin: 0 auto 22px;
    display: grid;
    gap: 14px;
}

.watch-layout {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
}

.content-grid {
    grid-template-columns: 1fr;
}

.video-panel,
.poster-panel,
.schedule-panel,
.facebook-panel {
    border: 1px solid rgba(52, 210, 255, .24);
    border-radius: 8px;
    background: rgba(5, 12, 21, .82);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .32);
    overflow: hidden;
}

.panel-title,
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(52, 210, 255, .18);
}

.panel-title span,
.section-head h2 {
    margin: 0;
    color: #ffffff;
    font-size: 18px;
    font-weight: 900;
}

.video-title-text {
    margin-right: auto;
}

.signal-pill {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .16);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.signal-pill.is-live {
    background: #e5162d;
    border-color: #ff5266;
    box-shadow: 0 0 16px rgba(229, 22, 45, .44);
}

.signal-pill.is-offline {
    background: rgba(90, 101, 116, .62);
    border-color: rgba(160, 172, 188, .32);
    color: #d8e3ec;
}

.signal-pill.is-checking {
    background: rgba(255, 210, 74, .16);
    border-color: rgba(255, 210, 74, .45);
    color: #ffeaa0;
}

.section-head {
    align-items: flex-start;
    flex-direction: column;
}

.section-head p {
    margin: 4px 0 0;
    color: #9fc6d6;
    line-height: 1.35;
}

.video-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.video-frame video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
}

.video-status {
    position: absolute;
    left: 12px;
    top: 12px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .68);
    color: #bfefff;
    font-size: 12px;
    pointer-events: none;
    transition: opacity .28s ease, transform .28s ease;
}

.video-status.is-hidden {
    opacity: 0;
    transform: translateY(-6px);
}

.poster-panel {
    display: flex;
    min-height: 100%;
    flex-direction: column;
}

.poster-panel-head {
    display: grid;
    gap: 7px;
    padding: 12px 14px 11px;
    border-bottom: 1px solid rgba(52, 210, 255, .18);
    text-align: center;
}

.poster-panel-head h2 {
    margin: 0;
    color: #ffffff;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: 0;
}

.poster-stage {
    position: relative;
    min-height: 0;
    flex: 1;
    padding: 12px;
}

.poster-card {
    position: relative;
    height: 100%;
    min-height: 410px;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid rgba(52, 210, 255, .22);
    background: #02070d;
}

.poster-card img {
    width: 100%;
    height: 100%;
    min-height: 410px;
    display: block;
    object-fit: cover;
}

.poster-info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 18px 16px;
    background: linear-gradient(180deg, rgba(2, 7, 13, 0), rgba(2, 7, 13, .92) 30%, rgba(2, 7, 13, .98));
}

.poster-info span {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    background: #ffd24a;
    color: #091018;
    font-size: 11px;
    font-weight: 900;
}

.poster-info strong {
    display: block;
    margin-top: 9px;
    color: #fff;
    font-size: 22px;
    line-height: 1.1;
}

.poster-info p {
    margin: 7px 0 0;
    color: #bfefff;
    line-height: 1.3;
}

.poster-vote-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.poster-vote-btn {
    width: 30px;
    min-height: 30px;
    padding: 0;
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
}

.poster-vote-btn.vote-up {
    border-color: rgba(47, 214, 118, .55);
    background: rgba(47, 214, 118, .16);
}

.poster-vote-btn.vote-down {
    border-color: rgba(255, 77, 103, .58);
    background: rgba(255, 77, 103, .16);
}

.poster-vote-btn.is-active {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .18), 0 0 18px rgba(25, 200, 255, .35);
}

.poster-vote-btn.vote-up.is-active {
    background: #2fd676;
    border-color: #2fd676;
}

.poster-vote-btn.vote-down.is-active {
    background: #ff4d67;
    border-color: #ff4d67;
}

.poster-score {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #6d7f8f;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
}

.poster-score.is-positive {
    color: #ffd24a;
}

.poster-score.is-negative {
    color: #ff9cac;
}

.poster-stars {
    display: inline-flex;
    gap: 2px;
    white-space: nowrap;
}

.poster-star {
    color: rgba(138, 154, 169, .42);
    text-shadow: none;
}

.poster-star.is-on {
    color: #ffd24a;
    text-shadow: 0 0 10px rgba(255, 210, 74, .42);
}

.poster-score-extra {
    min-width: 28px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 900;
}

.poster-vote-badge {
    position: absolute;
    left: 14px;
    bottom: 116px;
    z-index: 2;
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(4, 10, 17, .88);
    color: #091018;
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .32);
}

.poster-vote-down {
    background: rgba(4, 10, 17, .88);
    color: #fff;
}

.poster-strip {
    display: flex;
    justify-content: center;
    gap: 7px;
    padding: 0 12px 14px;
}

.poster-dot {
    width: 9px;
    height: 9px;
    min-height: 9px;
    padding: 0;
    border-radius: 50%;
    border-color: rgba(255, 255, 255, .28);
    background: rgba(255, 255, 255, .28);
}

.poster-dot.is-active {
    width: 24px;
    border-radius: 999px;
    background: #19c8ff;
    border-color: #19c8ff;
}

.schedule-list {
    display: grid;
    gap: 10px;
    padding: 14px;
}

.schedule-item {
    display: grid;
    grid-template-columns: 86px 1fr 122px;
    gap: 8px 12px;
    align-items: start;
    padding: 13px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    background: rgba(255, 255, 255, .045);
}

.schedule-item-actions {
    grid-column: 3;
    grid-row: span 2;
    display: grid;
    gap: 7px;
    align-content: start;
    justify-items: end;
}

.rewatch-btn {
    min-height: 30px;
    padding: 0 10px;
    border-color: rgba(255, 210, 74, .5);
    background: rgba(255, 210, 74, .13);
    color: #ffeaa0;
    font-size: 11px;
    white-space: nowrap;
}

.rewatch-count {
    justify-self: end;
    color: #ffd24a;
    font-size: 13px;
    font-weight: 900;
}

.schedule-item > .schedule-date {
    grid-column: 1;
    grid-row: span 2;
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(25, 200, 255, .14);
    color: #89e8ff;
    font-size: 12px;
    font-weight: 900;
}

.schedule-item strong {
    grid-column: 2;
    color: #fff;
}

.schedule-item p {
    grid-column: 2;
    margin: 0;
    color: #b7d4df;
    line-height: 1.35;
}

.schedule-item.is-live > .schedule-date {
    background: #ffd24a;
    color: #091018;
}

.legal-note {
    grid-column: 1 / -1;
    padding: 13px 15px;
    border: 1px solid rgba(255, 210, 74, .28);
    border-radius: 8px;
    background: rgba(255, 210, 74, .08);
    color: #d8edf5;
    line-height: 1.4;
}

.legal-note strong {
    display: block;
    margin-bottom: 5px;
    color: #ffd24a;
    font-size: 13px;
    font-weight: 900;
}

.legal-note p {
    margin: 0;
    font-size: 13px;
}

.facebook-panel iframe,
.fb-page {
    display: block;
    width: 100%;
    min-height: 520px;
    border: 0;
    background: #fff;
}

.facebook-frame-wrap {
    position: relative;
    min-height: 520px;
    background: #fff;
}

#fb-gadget-wrapper {
    position: relative;
    min-height: 520px;
    background: #fff;
}

#fb-gadget-wrapper .fb-row {
    position: relative;
    min-height: 520px;
    overflow: hidden;
    background: #fff;
}

#fb-gadget-wrapper .fb-iframe {
    display: block;
    width: 100%;
    min-height: 520px;
    border: 0;
    background: #fff;
}

.facebook-frame-wrap iframe,
.facebook-frame-wrap .fb-page {
    position: relative;
    z-index: 1;
    max-width: 100%;
}

.night-overlay {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 2;
    height: 76px;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(3, 7, 13, 0), rgba(3, 7, 13, .18));
}

.facebook-fallback {
    position: absolute;
    inset: auto 16px 16px 16px;
    z-index: 2;
    display: none;
    padding: 14px;
    border-radius: 8px;
    background: rgba(3, 8, 14, .92);
    color: #eafaff;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .32);
}

.facebook-fallback.is-visible {
    display: block;
}

.facebook-fallback p {
    margin: 6px 0 12px;
    color: #b7d4df;
}

.facebook-fallback a {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border-radius: 999px;
    background: #19c8ff;
    color: #04101a;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.facebook-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 14px 14px;
    border-top: 1px solid rgba(52, 210, 255, .18);
    background: rgba(5, 12, 21, .72);
}

.facebook-actions a {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border: 1px solid rgba(52, 210, 255, .35);
    border-radius: 999px;
    background: rgba(6, 21, 32, .72);
    color: #eafaff;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.facebook-actions a:hover {
    background: #19c8ff;
    color: #04101a;
}

.peli-footer {
    width: min(1440px, calc(100% - 28px));
    margin: 0 auto;
    padding: 18px 0 28px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #96bdcc;
    font-size: 13px;
}

.admin-page {
    background:
        linear-gradient(180deg, rgba(4, 9, 16, .9), rgba(4, 9, 16, .96)),
        url("assets/logo-mega-peli.png") center top / min(900px, 120vw) auto no-repeat,
        #03070d;
}

.admin-shell {
    width: min(1100px, calc(100% - 28px));
    margin: 34px auto;
    display: grid;
    gap: 16px;
}

.admin-card {
    border: 1px solid rgba(52, 210, 255, .24);
    border-radius: 8px;
    background: rgba(5, 12, 21, .88);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .32);
    padding: 18px;
}

.login-card {
    width: min(430px, 100%);
    margin: 80px auto 0;
}

.admin-card h1,
.admin-card h2,
.admin-card p {
    margin-top: 0;
}

.admin-card label {
    display: block;
    margin: 12px 0 6px;
    color: #c8e8f5;
    font-size: 13px;
    font-weight: 800;
}

.admin-card input,
.admin-card textarea {
    width: 100%;
    border: 1px solid rgba(52, 210, 255, .24);
    border-radius: 8px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    padding: 10px 11px;
    font: inherit;
    outline: none;
}

.admin-card textarea {
    min-height: 96px;
    resize: vertical;
}

.password-wrap {
    position: relative;
}

.password-wrap input {
    padding-right: 86px;
}

.password-toggle {
    position: absolute;
    top: 5px;
    right: 5px;
    min-height: 30px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.quick-type-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-type {
    min-height: 32px;
    font-size: 12px;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.admin-alert {
    margin: 12px 0;
    padding: 10px 12px;
    border-radius: 8px;
}

.admin-alert.ok {
    background: rgba(25, 200, 255, .16);
}

.admin-alert.error {
    background: rgba(255, 77, 103, .18);
}

.admin-schedule-list {
    display: grid;
    gap: 10px;
}

.admin-schedule-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    background: rgba(255, 255, 255, .045);
}

.admin-schedule-row span,
.admin-schedule-row p {
    display: block;
    margin: 4px 0 0;
    color: #b7d4df;
}

.admin-schedule-row .admin-vote-stat {
    display: inline-flex;
    width: fit-content;
    min-height: 28px;
    align-items: center;
    margin-top: 8px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 210, 74, .14);
    color: #ffd24a;
    font-size: 12px;
    font-weight: 900;
}

.danger-btn {
    border-color: rgba(255, 77, 103, .5);
    background: rgba(255, 77, 103, .2);
    color: #fff;
}

.logout-form {
    margin: 0;
}

.cinema-active {
    position: fixed;
    inset: 0;
    z-index: 100;
    border-radius: 0;
    background: #000;
}

.cinema-active .panel-title {
    background: rgba(0, 0, 0, .82);
}

.cinema-active .video-frame {
    height: calc(100vh - 61px);
    aspect-ratio: auto;
}

@media (max-width: 980px) {
    .watch-layout,
    .content-grid {
        grid-template-columns: 1fr;
    }

    .poster-card,
    .poster-card img {
        min-height: 360px;
    }

    .peli-hero {
        min-height: 280px;
    }
}

@media (max-width: 620px) {
    .peli-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .peli-nav {
        justify-content: flex-start;
    }

    .peli-hero {
        padding-top: 70px;
    }

    .hero-copy p {
        font-size: 15px;
    }

    .schedule-item {
        grid-template-columns: 1fr;
    }

    .schedule-item > .schedule-date,
    .schedule-item strong,
    .schedule-item p,
    .schedule-item-actions {
        grid-column: 1;
    }

    .schedule-item-actions {
        justify-items: start;
    }

    .schedule-item > .schedule-date {
        grid-row: auto;
        width: fit-content;
        padding: 0 12px;
    }

    .peli-footer {
        flex-direction: column;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .admin-schedule-row {
        grid-template-columns: 1fr;
    }
}
