* { box-sizing: border-box; }
html, body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    background:
        radial-gradient(circle at top right, rgba(24, 119, 242, .16), transparent 28%),
        linear-gradient(180deg, #09101d 0%, #050a13 100%);
    color: #fff;
    font-family: Tahoma, Arial, sans-serif;
}
body.megaplay-player-page { direction: rtl; }
a { color: inherit; }
button { font: inherit; }
.megaplay-stage {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.vnx-entry-screen,
.vnx-shell {
    width: min(1180px, 100%);
}
.vnx-entry-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 32px 20px;
    text-align: center;
}
.vnx-entry-screen h1 {
    margin: 0;
    font-size: clamp(24px, 3.4vw, 40px);
    line-height: 1.2;
}
.vnx-entry-screen p {
    margin: 0;
    max-width: 620px;
    color: #b9c5dc;
    line-height: 1.9;
}
.vnx-entry-button {
    width: 112px;
    height: 112px;
    border: none;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    box-shadow: 0 18px 45px rgba(185, 28, 28, .45);
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
}
.vnx-entry-button:hover,
.vnx-entry-button:focus-visible {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 22px 52px rgba(185, 28, 28, .58);
    outline: none;
}
.vnx-entry-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
}
.vnx-entry-icon svg {
    width: 100%;
    height: 100%;
}
.vnx-shell {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.vnx-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.vnx-back-button {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(13, 20, 34, .9);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(0,0,0,.22);
}
.vnx-back-button:hover,
.vnx-back-button:focus-visible {
    background: rgba(25, 37, 61, .95);
    outline: none;
}
.vnx-back-button svg { width: 22px; height: 22px; }
.vnx-back-button[hidden] { display: none !important; }
.vnx-mode-switcher {
    margin-inline-start: auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.vnx-mode-button {
    min-width: 148px;
    border: 0;
    border-radius: 14px;
    padding: 12px 18px;
    color: rgba(255,255,255,.96);
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
    opacity: .84;
}
.vnx-mode-button:hover,
.vnx-mode-button:focus-visible {
    transform: translateY(-1px);
    opacity: 1;
    outline: none;
}
.vnx-watch-button { background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%); }
.vnx-download-button { background: linear-gradient(135deg, #22c55e 0%, #15803d 100%); }
.vnx-mode-button.is-active {
    opacity: 1;
    box-shadow: 0 14px 30px rgba(0,0,0,.24);
}
.vnx-chooser,
.vnx-player-panel {
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 24px;
    background: rgba(8, 14, 25, .84);
    box-shadow: 0 22px 60px rgba(0,0,0,.28);
    backdrop-filter: blur(14px);
}
.vnx-chooser {
    padding: 24px;
}
.vnx-chooser-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}
.vnx-chooser-head strong {
    font-size: 22px;
    font-weight: 700;
    font-family: monospace;
    text-align: center;
    background: #26262a5e;
    padding: 10px;
    border-radius: 15px;
}
.vnx-chooser-head span {
    color: #9eb0cb;
    line-height: 1.8;
}
.vnx-server-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.vnx-server-card {
    border: 1px solid #ffffff16;
    border-radius: 18px;
    padding: 15px 16px;
    background: #26262aa3;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: right;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
    flex-direction: row-reverse;
    justify-content: space-between;
}
.vnx-server-card:hover,
.vnx-server-card:focus-visible {
    outline: none;
}
.vnx-server-card.is-current {
    border-color: rgba(59, 130, 246, .6);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, .24);
}
.vnx-server-icon {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #454547;
}
.vnx-server-icon svg {
    width: 20px;
    height: 20px;
}
.vnx-server-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.vnx-server-copy strong {
    font-size: 15px;
    line-height: 1.55;
}
.vnx-server-copy small {
    font-size: 12px;
    color: #757576;
    direction: ltr;
    text-align: right;
}
.vnx-player-panel {
    padding: 14px;
}
.vnx-player-frame {
    position: relative;
    overflow: hidden;
    min-height: min(70vh, 760px);
    border-radius: 18px;
    background: #000;
}
#megaplay-player,
#megaplay-player > div,
#megaplay-native {
    width: 100% !important;
    height: min(70vh, 760px) !important;
}
#megaplay-native {
    display: block;
    object-fit: contain;
    background: #000;
}
.megaplay-logo {
    position: absolute;
    z-index: 9999;
    display: block;
    max-height: 72px;
    opacity: .94;
    line-height: 0;
    pointer-events: auto;
}
.megaplay-logo img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 72px;
    object-fit: contain;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,.75));
}
a.megaplay-logo {
    cursor: pointer;
    transition: opacity .18s ease, transform .18s ease;
}
a.megaplay-logo:hover,
a.megaplay-logo:focus-visible {
    opacity: 1;
    transform: translateY(-1px);
    outline: none;
}
.megaplay-logo-top-left { top: 18px; left: 18px; }
.megaplay-logo-top-right { top: 18px; right: 18px; }
.megaplay-logo-bottom-left { bottom: 58px; left: 18px; }
.megaplay-logo-bottom-right { bottom: 58px; right: 18px; }
.megaplay-custom-ad {
    position: absolute;
    z-index: 10010;
    max-width: calc(100% - 24px);
    max-height: calc(100% - 24px);
    direction: ltr;
    pointer-events: none;
}
.megaplay-custom-ad-overlay-top {
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
}
.megaplay-custom-ad-overlay-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.megaplay-custom-ad-overlay-bottom {
    bottom: 72px;
    left: 50%;
    transform: translateX(-50%);
}
.megaplay-custom-ad-content {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    overflow: visible;
    pointer-events: auto;
}
.megaplay-custom-ad-content iframe,
.megaplay-custom-ad-content img,
.megaplay-custom-ad-content video {
    max-width: 100%;
}
.megaplay-custom-ad-close {
    position: absolute;
    z-index: 2;
    top: -12px;
    right: -12px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 50%;
    color: #fff;
    background: rgba(5, 8, 14, .92);
    box-shadow: 0 6px 20px rgba(0,0,0,.48);
    font: 700 21px/27px Arial, sans-serif;
    text-align: center;
    cursor: pointer;
    pointer-events: auto;
}
.megaplay-custom-ad-close:hover,
.megaplay-custom-ad-close:focus-visible {
    background: #111827;
    outline: 2px solid rgba(255,255,255,.65);
    outline-offset: 1px;
}
.megaplay-custom-ad-close[hidden] { display: none !important; }
.megaplay-error {
    min-height: min(70vh, 760px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 28px;
    text-align: center;
    color: #fff;
    background: radial-gradient(circle at center, #182027 0, #000 70%);
}
.megaplay-error strong { font-size: 24px; }
.megaplay-error span { max-width: 760px; line-height: 1.8; color: #cbd5e1; }

@media (max-width: 920px) {
    .vnx-server-grid { grid-template-columns: 1fr; }
    .megaplay-stage { padding: 18px; }
}

@media (max-width: 640px) {
    .megaplay-stage { padding: 14px; }
    .vnx-entry-button { width: 92px; height: 92px; }
    .vnx-entry-icon { width: 36px; height: 36px; }
    .vnx-topbar {
        flex-direction: column;
        align-items: stretch;
    }
    .vnx-mode-switcher { margin-inline-start: 0; width: 100%; }
    .vnx-mode-button { flex: 1 1 0; min-width: 0; }
    .vnx-chooser,
    .vnx-player-panel { padding: 16px; }
    .vnx-chooser-head strong { font-size: 19px; }
    .vnx-server-card { padding: 14px; }
    .vnx-server-copy strong { font-size: 14px; }
    .megaplay-logo { max-width: 90px; max-height: 48px; }
    .megaplay-logo img { max-height: 48px; }
    .megaplay-logo-top-left { top: 10px; left: 10px; }
    .megaplay-logo-top-right { top: 10px; right: 10px; }
    .megaplay-custom-ad { max-width: calc(100% - 16px); }
    .megaplay-custom-ad-overlay-top { top: 8px; }
    .megaplay-custom-ad-overlay-bottom { bottom: 64px; }
    #megaplay-player,
    #megaplay-player > div,
    #megaplay-native,
    .vnx-player-frame,
    .megaplay-error {
        min-height: 54vh;
        height: 54vh !important;
    }
}

body.megaplay-logo-hide-fullscreen.megaplay-is-fullscreen .megaplay-logo {
    display: none !important;
}
