/*
 * FapSwipe Native Player media stage + interaction surface.
 *
 * Version 0.11.x keeps selectable feed skins on top of the stable Fit + gesture stage. The stage owns
 * geometry while the <video> remains the browser's native decoding surface.
 * object-fit:contain is deliberate: FapSwipe never crops source composition by
 * default. Future zoom/fill modes can transform this same media surface without
 * changing the stored source or recreating the video element.
 */
.fapswipe-native-stage {
    position: relative;
    max-width: 100%;
    line-height: 0;
}

.fapswipe-native-stage .fapswipe-native-video {
    display: block;
    max-width: 100%;
    max-height: 100dvh;
}

/*
 * FEED MEDIA STAGE
 * ----------------
 * Desktop keeps the established contained presentation. Touch-first feed
 * surfaces override this below and honor Core's full-stage contract so a tall
 * phone never centers a shorter 72% player inside a 100dvh swipe. The JS
 * controller still publishes VisualViewport metrics for deterministic Fit,
 * rotation, and zoom/pan clamping.
 */
.fapswipe-native-stage[data-fapswipe-surface="feed"] {
    box-sizing: border-box;
    display: grid;
    place-items: center;
    width: calc(100% - 24px);
    height: min(var(--fapswipe-native-portrait-stage-height, 72dvh), 760px);
    margin-inline: auto;
    overflow: hidden;
    background: #000;
}

/*
 * Mobile/touch feed contract (0.11.2+)
 * -----------------------------------
 * Core owns the full dynamic-viewport swipe surface. On touch-first devices the
 * Native Player must fill that surface rather than applying the older portrait
 * breathing-room cap. Controls are absolutely positioned inside this same stage,
 * so filling the stage also keeps mute/fullscreen anchored to the visible feed
 * viewport instead of drifting down with a centered short player.
 *
 * This is feed-only. `/watch/` remains conventional and desktop keeps the
 * contained presentation above. Safe-area protection stays on the controls.
 */
@media (hover: none) and (pointer: coarse) {
    .fapswipe-native-stage[data-fapswipe-surface="feed"] {
        align-self: stretch;
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        margin: 0;
    }
}

/*
 * Portrait-source touch alignment (0.11.4+)
 * ----------------------------------------
 * Alignment follows the MEDIA, not the handset orientation. A portrait/vertical
 * source can be shorter than a modern tall phone viewport; top-aligning that Fit
 * rectangle spends the unavoidable spare height below the video instead of
 * splitting it above/below. Landscape and square sources retain the default
 * centered Fit presentation, which is much more natural for wide media.
 *
 * data-media-orientation is rendered from provider metadata when known and is
 * refreshed from decoded videoWidth/videoHeight after metadata loads. Unknown
 * media stays centered until its factual geometry is available.
 */
@media (hover: none) and (pointer: coarse) and (orientation: portrait) {
    .fapswipe-native-stage[data-fapswipe-surface="feed"][data-media-orientation="portrait"] {
        place-items: start center;
        align-content: start;
    }

    .fapswipe-native-stage[data-fapswipe-surface="feed"][data-media-orientation="portrait"] .fapswipe-native-video {
        align-self: start;
        justify-self: center;
    }
}

.fapswipe-native-stage[data-fapswipe-surface="feed"] .fapswipe-native-video {
    /*
     * JS writes the exact contained pixel rectangle from the stage + decoded
     * media dimensions. auto/max fallbacks keep the video sane before metadata
     * is available. This avoids theme/browser rules stretching a portrait
     * replaced element into a landscape box.
     */
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center center;
}

/*
 * Phone/tablet landscape is the useful exception to the portrait breathing-room
 * rule. A short landscape viewport should behave more like a media viewer: use
 * almost all available visual height and let contain-fit decide the final video
 * rectangle. Safe-area insets protect notches/rounded corners without requiring
 * device-specific JavaScript.
 */
@media (orientation: landscape) and (max-height: 600px) {
    .fapswipe-native-stage[data-fapswipe-surface="feed"] {
        width: calc(
            100% - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) - 8px
        );
        height: calc(
            var(--fapswipe-native-viewport-height, 100dvh)
            - env(safe-area-inset-top, 0px)
            - env(safe-area-inset-bottom, 0px)
            - 8px
        );
        max-height: none;
    }
}

/*
 * /watch/ remains intentionally conventional in this release. It keeps native
 * controls and its previous sizing behavior; the Fit stage is a feed concern
 * until we have finished testing the media interaction model.
 */
.fapswipe-native-stage[data-fapswipe-surface="single"] .fapswipe-native-video {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100dvh;
}

.fapswipe-native-stage[data-fapswipe-feed-interaction="1"] {
    cursor: pointer;
    /*
     * Gesture ownership is intentionally local to the media stage. At 1x the
     * pointer stream still bubbles to vertical Swiper; with two contacts Native
     * Player performs media pinch zoom; above 1x one contact pans the media.
     * This does not disable browser zoom outside the video stage.
     */
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/*
 * Critical cross-browser rule: the feed's native <video> cannot become a
 * competing drag surface. The stage receives the hit; the event still bubbles
 * naturally to Swiper. /watch/ videos are unaffected and retain native controls.
 */
.fapswipe-native-stage[data-fapswipe-feed-interaction="1"] .fapswipe-native-video {
    pointer-events: none;
}

.fapswipe-native-stage[data-fapswipe-zoomed="1"] {
    cursor: grab;
}

.fapswipe-native-stage[data-fapswipe-zoomed="1"][data-fapswipe-gesture="pan"] {
    cursor: grabbing;
}

/* Promote only actively zoomed media to a compositor transform layer. */
.fapswipe-native-stage[data-fapswipe-zoomed="1"] .fapswipe-native-video {
    will-change: transform;
}

.fapswipe-native-stage[data-fapswipe-feed-interaction="1"]:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
}

/*
 * Double-tap zoom/reset is the only programmatic zoom animation. Pinch and pan
 * stay direct so the media follows the fingers without easing lag. Keeping the
 * transition marker on the stage also means future controls can cancel/replace
 * this behavior without inspecting inline styles.
 */
.fapswipe-native-stage[data-fapswipe-zoom-transition="1"] .fapswipe-native-video {
    transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
    .fapswipe-native-stage[data-fapswipe-zoom-transition="1"] .fapswipe-native-video {
        transition-duration: 1ms;
    }
}


/*
 * FEED PLAYER SKINS
 * -----------------
 * Playback and gestures are shared. A skin only changes player chrome.
 *
 * - swipe: reference-inspired default for vertical feeds.
 * - bare: the smallest useful playback UI.
 * - full: conventional custom controls.
 *
 * Feed title/tags/social actions intentionally live outside this stylesheet.
 */

.fapswipe-native-controls,
.fapswipe-native-controls *,
.fapswipe-native-center-state,
.fapswipe-native-center-state * {
    box-sizing: border-box;
}

.fapswipe-native-controls {
    color: var(--fapswipe-ui-control-text, #fff);
    line-height: 1;
}

.fapswipe-native-control {
    appearance: none;
    display: inline-grid;
    place-items: center;
    width: var(--fapswipe-ui-control-size, 40px);
    height: var(--fapswipe-ui-control-size, 40px);
    margin: 0;
    padding: 10px;
    border: 1px solid var(--fapswipe-ui-control-border, rgb(255 255 255 / 0.24));
    border-radius: 999px;
    background: var(--fapswipe-ui-control-bg, rgb(8 8 8 / 0.58));
    box-shadow: var(--fapswipe-ui-control-shadow, 0 4px 14px rgb(0 0 0 / 0.42), inset 0 1px 0 rgb(255 255 255 / 0.08));
    color: var(--fapswipe-ui-control-text, #fff);
    cursor: pointer;
    opacity: 0.94;
    touch-action: manipulation;
    transition:
        opacity 140ms ease,
        background-color 140ms ease,
        border-color 140ms ease,
        box-shadow 140ms ease,
        transform 140ms ease;
}

.fapswipe-native-control:hover,
.fapswipe-native-control:focus-visible {
    background: var(--fapswipe-ui-control-bg-hover, rgb(8 8 8 / 0.78));
    border-color: var(--fapswipe-ui-control-border-hover, rgb(255 255 255 / 0.42));
    opacity: 1;
}

.fapswipe-native-control:active {
    transform: scale(0.94);
}

.fapswipe-native-control:focus-visible,
.fapswipe-native-progress:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.fapswipe-native-icon,
.fapswipe-native-control > svg,
.fapswipe-native-center-icon > svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.fapswipe-native-icon-pause,
.fapswipe-native-icon-sound {
    display: none;
}

.fapswipe-native-stage[data-fapswipe-playback-state="playing"] .fapswipe-native-icon-play {
    display: none;
}

.fapswipe-native-stage[data-fapswipe-playback-state="playing"] .fapswipe-native-icon-pause {
    display: block;
}

.fapswipe-native-stage[data-fapswipe-muted="0"] .fapswipe-native-icon-muted {
    display: none;
}

.fapswipe-native-stage[data-fapswipe-muted="0"] .fapswipe-native-icon-sound {
    display: block;
}

.fapswipe-native-time {
    min-width: 3ch;
    color: #fff;
    font: 500 12px/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgb(0 0 0 / 0.8);
}

/*
 * Progress is intentionally plain/monochrome. JS updates only the CSS percentage
 * variable; seeking remains the same native range input used in 0.9.x.
 */
.fapswipe-native-progress {
    --fapswipe-native-progress-value: 0%;

    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    min-width: 70px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    touch-action: none;
}

.fapswipe-native-progress::-webkit-slider-runnable-track {
    height: 3px;
    border: 0;
    border-radius: 999px;
    background:
        linear-gradient(
            to right,
            currentColor 0,
            currentColor var(--fapswipe-native-progress-value),
            rgb(255 255 255 / 0.35) var(--fapswipe-native-progress-value),
            rgb(255 255 255 / 0.35) 100%
        );
}

.fapswipe-native-progress::-moz-range-track {
    height: 3px;
    border: 0;
    border-radius: 999px;
    background: rgb(255 255 255 / 0.35);
}

.fapswipe-native-progress::-moz-range-progress {
    height: 3px;
    border: 0;
    border-radius: 999px;
    background: currentColor;
}

.fapswipe-native-progress::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    margin-top: -4.5px;
    border: 0;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 1px 4px rgb(0 0 0 / 0.45);
    transition: transform 120ms ease, opacity 120ms ease;
}

.fapswipe-native-progress::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 1px 4px rgb(0 0 0 / 0.45);
    transition: transform 120ms ease, opacity 120ms ease;
}

.fapswipe-native-progress:disabled {
    cursor: default;
    opacity: 0.45;
}

/* Center paused-state cue used by the swipe and bare skins. */
.fapswipe-native-center-state {
    position: absolute;
    z-index: 44;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    padding: 18px;
    border-radius: 999px;
    border: 1px solid rgb(255 255 255 / 0.18);
    background: rgb(8 8 8 / 0.52);
    box-shadow: 0 6px 22px rgb(0 0 0 / 0.38), inset 0 1px 0 rgb(255 255 255 / 0.07);
    color: #fff;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.88);
    transition: opacity 150ms ease, transform 150ms ease;
}

.fapswipe-native-center-icon {
    display: block;
    width: 100%;
    height: 100%;
}

:is(html[data-fapswipe-native-skin="swipe"], html:not([data-fapswipe-native-skin])) .fapswipe-native-stage[data-fapswipe-playback-state="paused"] .fapswipe-native-center-state,
html[data-fapswipe-native-skin="bare"] .fapswipe-native-stage[data-fapswipe-playback-state="paused"] .fapswipe-native-center-state {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* -------------------------------------------------------------------------
 * SWIPE SKIN — reference-inspired default
 * ---------------------------------------------------------------------- */

:is(html[data-fapswipe-native-skin="swipe"], html:not([data-fapswipe-native-skin])) .fapswipe-native-stage .fapswipe-native-controls {
    position: absolute;
    z-index: 45;
    inset: 0;
    opacity: 1;
    visibility: visible;
    pointer-events: none;
}

:is(html[data-fapswipe-native-skin="swipe"], html:not([data-fapswipe-native-skin])) .fapswipe-native-stage .fapswipe-native-play,
:is(html[data-fapswipe-native-skin="swipe"], html:not([data-fapswipe-native-skin])) .fapswipe-native-stage .fapswipe-native-time {
    display: none;
}

:is(html[data-fapswipe-native-skin="swipe"], html:not([data-fapswipe-native-skin])) .fapswipe-native-stage .fapswipe-native-mute,
:is(html[data-fapswipe-native-skin="swipe"], html:not([data-fapswipe-native-skin])) .fapswipe-native-stage .fapswipe-native-fullscreen {
    position: absolute;
    right: max(12px, env(safe-area-inset-right, 0px));
    width: var(--fapswipe-ui-control-size, 40px);
    height: var(--fapswipe-ui-control-size, 40px);
    padding: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(4px);
}

:is(html[data-fapswipe-native-skin="swipe"], html:not([data-fapswipe-native-skin])) .fapswipe-native-stage .fapswipe-native-mute {
    top: max(12px, env(safe-area-inset-top, 0px));
}

:is(html[data-fapswipe-native-skin="swipe"], html:not([data-fapswipe-native-skin])) .fapswipe-native-stage .fapswipe-native-fullscreen {
    top: calc(
        max(12px, env(safe-area-inset-top, 0px))
        + var(--fapswipe-ui-control-size, 40px)
        + var(--fapswipe-ui-control-gap, 9px)
    );
}

:is(html[data-fapswipe-native-skin="swipe"], html:not([data-fapswipe-native-skin])) .fapswipe-native-stage[data-fapswipe-controls-visible="1"] .fapswipe-native-mute,
:is(html[data-fapswipe-native-skin="swipe"], html:not([data-fapswipe-native-skin])) .fapswipe-native-stage[data-fapswipe-controls-visible="1"] .fapswipe-native-fullscreen {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

:is(html[data-fapswipe-native-skin="swipe"], html:not([data-fapswipe-native-skin])) .fapswipe-native-stage .fapswipe-native-mute .fapswipe-native-icon,
:is(html[data-fapswipe-native-skin="swipe"], html:not([data-fapswipe-native-skin])) .fapswipe-native-stage .fapswipe-native-fullscreen > svg,
html[data-fapswipe-native-skin="bare"] .fapswipe-native-stage .fapswipe-native-mute .fapswipe-native-icon {
    width: var(--fapswipe-ui-icon-size, 18px);
    height: var(--fapswipe-ui-icon-size, 18px);
}

:is(html[data-fapswipe-native-skin="swipe"], html:not([data-fapswipe-native-skin])) .fapswipe-native-stage .fapswipe-native-progress {
    position: absolute;
    right: 0;
    bottom: max(0px, env(safe-area-inset-bottom, 0px));
    left: 0;
    z-index: 2;
    height: 22px;
    min-width: 0;
    pointer-events: none;
}

/* Portrait-phone control anchoring follows the actual fitted media rectangle.
 * Portrait sources have --fit-top:0 because they are top-aligned. Wide/square
 * sources publish a centered --fit-top from deterministic Fit geometry. This
 * keeps mute/fullscreen, pause feedback, and the thin seek line attached to the
 * video instead of drifting into the stage's letterbox space. */
@media (hover: none) and (pointer: coarse) and (orientation: portrait) {
    :is(html[data-fapswipe-native-skin="swipe"], html:not([data-fapswipe-native-skin]))
        .fapswipe-native-stage[data-fapswipe-surface="feed"] .fapswipe-native-mute {
        top: calc(var(--fapswipe-native-fit-top, 0px) + max(12px, env(safe-area-inset-top, 0px)));
    }

    :is(html[data-fapswipe-native-skin="swipe"], html:not([data-fapswipe-native-skin]))
        .fapswipe-native-stage[data-fapswipe-surface="feed"] .fapswipe-native-fullscreen {
        top: calc(
            var(--fapswipe-native-fit-top, 0px)
            + max(12px, env(safe-area-inset-top, 0px))
            + var(--fapswipe-ui-control-size, 40px)
            + var(--fapswipe-ui-control-gap, 9px)
        );
    }

    /* Wide/square media on portrait phones uses the same general media-stage
     * geometry as the action rail. Move mute/fullscreen into the secondary lane
     * to the left of the engagement rail so 16:9 content does not cause the two
     * vertical stacks to collide. Portrait media keeps the primary top-right lane. */
    :is(html[data-fapswipe-native-skin="swipe"], html:not([data-fapswipe-native-skin]))
        .fapswipe-native-stage[data-fapswipe-surface="feed"][data-media-orientation="landscape"] .fapswipe-native-mute,
    :is(html[data-fapswipe-native-skin="swipe"], html:not([data-fapswipe-native-skin]))
        .fapswipe-native-stage[data-fapswipe-surface="feed"][data-media-orientation="landscape"] .fapswipe-native-fullscreen,
    :is(html[data-fapswipe-native-skin="swipe"], html:not([data-fapswipe-native-skin]))
        .fapswipe-native-stage[data-fapswipe-surface="feed"][data-media-orientation="square"] .fapswipe-native-mute,
    :is(html[data-fapswipe-native-skin="swipe"], html:not([data-fapswipe-native-skin]))
        .fapswipe-native-stage[data-fapswipe-surface="feed"][data-media-orientation="square"] .fapswipe-native-fullscreen {
        right: var(--fapswipe-nav-rail-inset, calc(var(--fapswipe-ui-rail-inset, 24px) + var(--fapswipe-ui-control-size, 40px) + var(--fapswipe-ui-control-gap, 9px)));
    }

    :is(html[data-fapswipe-native-skin="swipe"], html:not([data-fapswipe-native-skin]))
        .fapswipe-native-stage[data-fapswipe-surface="feed"] .fapswipe-native-progress {
        top: max(0px, calc(var(--fapswipe-native-fit-top, 0px) + var(--fapswipe-native-fit-height, 100%) - 22px));
        bottom: auto;
    }

    html[data-fapswipe-native-skin="bare"]
        .fapswipe-native-stage[data-fapswipe-surface="feed"] .fapswipe-native-progress {
        top: max(0px, calc(var(--fapswipe-native-fit-top, 0px) + var(--fapswipe-native-fit-height, 100%) - 20px));
        bottom: auto;
    }

    .fapswipe-native-stage[data-fapswipe-surface="feed"] .fapswipe-native-center-state {
        top: var(--fapswipe-native-fit-center-y, 50%);
    }
}

:is(html[data-fapswipe-native-skin="swipe"], html:not([data-fapswipe-native-skin])) .fapswipe-native-stage[data-fapswipe-controls-visible="1"] .fapswipe-native-progress {
    pointer-events: auto;
}

:is(html[data-fapswipe-native-skin="swipe"], html:not([data-fapswipe-native-skin])) .fapswipe-native-stage:not([data-fapswipe-controls-visible="1"])
    .fapswipe-native-progress::-webkit-slider-thumb {
    opacity: 0;
    transform: scale(0.65);
}

:is(html[data-fapswipe-native-skin="swipe"], html:not([data-fapswipe-native-skin])) .fapswipe-native-stage:not([data-fapswipe-controls-visible="1"])
    .fapswipe-native-progress::-moz-range-thumb {
    opacity: 0;
    transform: scale(0.65);
}

/* -------------------------------------------------------------------------
 * BARE BONES — progress + audio, stage tap handles play/pause
 * ---------------------------------------------------------------------- */

html[data-fapswipe-native-skin="bare"] .fapswipe-native-stage .fapswipe-native-controls {
    position: absolute;
    z-index: 45;
    inset: 0;
    opacity: 1;
    visibility: visible;
    pointer-events: none;
}

html[data-fapswipe-native-skin="bare"] .fapswipe-native-stage .fapswipe-native-play,
html[data-fapswipe-native-skin="bare"] .fapswipe-native-stage .fapswipe-native-time,
html[data-fapswipe-native-skin="bare"] .fapswipe-native-stage .fapswipe-native-fullscreen {
    display: none;
}

html[data-fapswipe-native-skin="bare"] .fapswipe-native-stage .fapswipe-native-mute {
    position: absolute;
    top: max(12px, env(safe-area-inset-top, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    width: var(--fapswipe-ui-control-size, 40px);
    height: var(--fapswipe-ui-control-size, 40px);
    padding: 0;
    opacity: 0;
    pointer-events: none;
}

html[data-fapswipe-native-skin="bare"] .fapswipe-native-stage[data-fapswipe-controls-visible="1"] .fapswipe-native-mute {
    opacity: 1;
    pointer-events: auto;
}

html[data-fapswipe-native-skin="bare"] .fapswipe-native-stage .fapswipe-native-progress {
    position: absolute;
    right: 0;
    bottom: max(0px, env(safe-area-inset-bottom, 0px));
    left: 0;
    height: 20px;
    min-width: 0;
    pointer-events: none;
}

html[data-fapswipe-native-skin="bare"] .fapswipe-native-stage[data-fapswipe-controls-visible="1"] .fapswipe-native-progress {
    pointer-events: auto;
}

html[data-fapswipe-native-skin="bare"] .fapswipe-native-stage:not([data-fapswipe-controls-visible="1"])
    .fapswipe-native-progress::-webkit-slider-thumb {
    opacity: 0;
}

html[data-fapswipe-native-skin="bare"] .fapswipe-native-stage:not([data-fapswipe-controls-visible="1"])
    .fapswipe-native-progress::-moz-range-thumb {
    opacity: 0;
}

/* -------------------------------------------------------------------------
 * FULL CONTROLS — conventional dock
 * ---------------------------------------------------------------------- */

html[data-fapswipe-native-skin="full"] .fapswipe-native-stage .fapswipe-native-center-state {
    display: none;
}

html[data-fapswipe-native-skin="full"] .fapswipe-native-stage .fapswipe-native-controls {
    position: absolute;
    z-index: 45;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    left: 10px;
    display: grid;
    grid-template-columns: 40px 40px auto minmax(70px, 1fr) auto 40px;
    gap: 7px;
    align-items: center;
    min-height: 48px;
    padding: 6px 8px;
    border: 1px solid rgb(255 255 255 / 0.12);
    border-radius: 12px;
    background: rgb(0 0 0 / 0.62);
    box-shadow: 0 4px 18px rgb(0 0 0 / 0.22);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(5px);
    transition:
        opacity 140ms ease,
        transform 140ms ease,
        visibility 140ms linear;
}

html[data-fapswipe-native-skin="full"] .fapswipe-native-stage[data-fapswipe-controls-visible="1"] .fapswipe-native-controls {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* Standard Fullscreen keeps our own controls/gestures and lets Fit own geometry. */
.fapswipe-native-stage:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    background: #000;
}

.fapswipe-native-stage:fullscreen .fapswipe-native-video {
    max-width: 100% !important;
    max-height: 100% !important;
}

@media (max-width: 560px) {
    .fapswipe-native-control {
        width: var(--fapswipe-ui-control-size, 38px);
        height: var(--fapswipe-ui-control-size, 38px);
        padding: 8px;
    }

    .fapswipe-native-center-state {
        width: 62px;
        height: 62px;
        padding: 17px;
    }

    html[data-fapswipe-native-skin="full"] .fapswipe-native-stage .fapswipe-native-controls {
        right: 6px;
        bottom: max(6px, env(safe-area-inset-bottom, 0px));
        left: 6px;
        grid-template-columns: 36px 36px auto minmax(52px, 1fr) auto 36px;
        gap: 4px;
        min-height: 44px;
        padding: 5px 6px;
    }

    html[data-fapswipe-native-skin="full"] .fapswipe-native-stage .fapswipe-native-control {
        width: 36px;
        height: 36px;
        padding: 7px;
    }

    .fapswipe-native-time {
        font-size: 11px;
    }

    :is(html[data-fapswipe-native-skin="swipe"], html:not([data-fapswipe-native-skin])) .fapswipe-native-stage .fapswipe-native-mute,
    :is(html[data-fapswipe-native-skin="swipe"], html:not([data-fapswipe-native-skin])) .fapswipe-native-stage .fapswipe-native-fullscreen {
        right: max(10px, env(safe-area-inset-right, 0px));
    }

    :is(html[data-fapswipe-native-skin="swipe"], html:not([data-fapswipe-native-skin])) .fapswipe-native-stage .fapswipe-native-mute,
    :is(html[data-fapswipe-native-skin="swipe"], html:not([data-fapswipe-native-skin])) .fapswipe-native-stage .fapswipe-native-fullscreen,
    html[data-fapswipe-native-skin="bare"] .fapswipe-native-stage .fapswipe-native-mute {
        padding: 0;
    }

    :is(html[data-fapswipe-native-skin="swipe"], html:not([data-fapswipe-native-skin])) .fapswipe-native-stage .fapswipe-native-mute,
    html[data-fapswipe-native-skin="bare"] .fapswipe-native-stage .fapswipe-native-mute {
        top: max(10px, env(safe-area-inset-top, 0px));
    }

    :is(html[data-fapswipe-native-skin="swipe"], html:not([data-fapswipe-native-skin])) .fapswipe-native-stage .fapswipe-native-fullscreen {
        top: calc(
            max(10px, env(safe-area-inset-top, 0px))
            + var(--fapswipe-ui-control-size, 38px)
            + var(--fapswipe-ui-control-gap, 9px)
        );
    }
}

@media (prefers-reduced-motion: reduce) {
    .fapswipe-native-control,
    .fapswipe-native-center-state,
    html[data-fapswipe-native-skin="full"] .fapswipe-native-stage .fapswipe-native-controls {
        transition: none;
    }
}
