:root{
    --vh: 1vh;
    --bottomAdvHeight: 0px;
    /* Cambiar el margen tambén en el js */
    --headerMargin: 12px;
    --headerHeight: calc(var(--vh, 1vh) * 7);
    --storyPlayerHeight: calc(
        calc(
            calc(
                var(--vh, 1vh) * 100
            ) - calc(
                var(--headerHeight) + var(--headerMargin)
            )
        ) - var(--bottomAdvHeight)
    );
    --storyPlayerMaxWidth: calc(var(--storyPlayerHeight)/1.5);
    --spcModalMaxWidth: 300px;
    --bottomAdvHeight: 50px;
}

*{
    box-sizing: unset !important;
}

body{
    background-color: black !important;
    margin: 0px !important;
    overflow: hidden;
}

#story-player, .SPC_player-main{
    position: relative;
    width: 100%;
    height: var(--storyPlayerHeight);
    max-width: var(--storyPlayerMaxWidth);
    margin: 0px auto;
}

.SPC_player-header{
    background-color: rgb(0, 0, 0);
    position: relative;
    line-height: var(--headerHeight);
    height: var(--headerHeight);
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.75);
    
    font-weight: bold;
    font-size: large;
    
    text-align: center;
    padding: 6px 15px;
}

.SPC_player-header .story-title{
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

#playerLoader{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-6rem,-6rem);
}

/* ----- Publicidad ----- */
.bottom-advertising, .SPC_player-footer{
    position: fixed;
    width: 100%;
    height: var(--bottomAdvHeight);
    bottom: 0;
    margin: 0px;
    background-color: rgb(0, 0, 0)
}

/*.lateral-advertising-r{
    position: fixed;
    width: 100px;
    height: calc(var(--vh, 1vh) * 93);
    top: calc(7vh + 12px);
    right: 0px;
}

.lateral-advertising-l{
    position: fixed;
    width: 100px;
    height: calc(var(--vh, 1vh) * 93);
    top: calc(calc(var(--vh, 1vh) * 7) + 12px);
    left: 0px;
}*/

 /*Loading panel position*/
 #SPC_loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-6rem,-6rem);
    z-index: 10001;
    color: white;
}

/*Loading panel size*/
.spinner-border {
    width: 12rem !important;
    height: 12rem !important;
}

.SPC_prev-ad div:empty:after{
    position: relative;
    display: flex;
    width: 100%;
    max-width: 320px;
    height: 100%;
    content: "Publicidad";
    margin: 5px auto;
    color: #999;
    font-weight: 300;
    font-family: "Public Sans",sans-serif;
    z-index: 0;
    border: 1px solid #302f2f;
    align-items: center;
    justify-content: center;
}

/*ADSOCY ADS*/
#adsocy-ad-dl {
    position: fixed;
    z-index: 10;
    top: calc(var(--headerHeight) + var(--headerMargin) + (var(--storyPlayerHeight) / 2) - 300px);
    left: calc(25% - 320px);
    width: 300px;
    height: 600px;
    opacity: 1;
    transition: opacity 1s ease-in-out;
}
#adsocy-ad-dl.adsocy-ad-dl-hidden {
    opacity: 0;
    transition: opacity 1s ease-in-out;
}
#adsocy-ad-dl iframe {
    width: 100%;
    height: 100%;
    border: none;
}
body:not([data-mode="desktop_big"]) #adsocy-ad-dl {
    display: none;
}
@media (max-height: 850px) {
    #adsocy-ad-dl {
        top: calc(var(--headerHeight) + var(--headerMargin) + (var(--storyPlayerHeight) / 2) - 250px);
        left: calc(25% - 270px);
        width: 250px;
        height: 500px;
    }
}

#adsocy-ad-nd,
#adsocy-ad-toggle {
    position: absolute;
    z-index: 10;
    top: calc(50% - 50px + var(--headerHeight));
    right: 0;
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.7);
    color: #000;
    border-radius: 27px 0 0 27px;
    padding: 2px 10px 2px 2px;
    opacity: 1;
    pointer-events: all;
    transition: all 0.4s ease-in-out;
    cursor: pointer;
}
body[data-mode="mobile"] #adsocy-ad-nd,
body[data-mode="mobile"] #adsocy-ad-toggle {
    width: 40px;
    height: 40px;
    top: calc((var(--storyPlayerHeight) / 2) + var(--headerHeight) - 40px);
}
#adsocy-ad-nd.adsocy-ad-nd-hidden,
#adsocy-ad-toggle.adsocy-ad-toggle-hidden {
    right: -70px;
    pointer-events: none;
}
#adsocy-ad-nd img,
#adsocy-ad-toggle img {
    width: 100%;
    border-radius: 50%;
}
#adsocy-ad-nd div,
#adsocy-ad-toggle div {
    position: absolute;
    right: 2px;
    bottom: 2px;
    font-size: 8px;
    font-weight: 700;
    color: #000;
}

#adsocy-ad-modal {
    position: fixed;
    z-index: 20;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    opacity: 1;
    pointer-events: all;
    transition: all 0.5s ease-in-out;
}
#adsocy-ad-modal.adsocy-ad-modal-hidden {
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s ease-in-out;
}
.adsocy-ad-modal-header {
    background-color: rgb(0, 0, 0);
    position: relative;
    line-height: var(--headerHeight);
    height: var(--headerHeight);
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.75);
    font-weight: bold;
    font-size: large;
    text-align: center;
    padding: 6px 5px 6px 0px;
    padding-left: var(--headerHeight);
    display: flex;
    flex-direction: row;
    width: calc(100% - var(--headerHeight) - 10px);
    max-width: calc(450px - var(--headerHeight) - 10px);
}
body[data-mode="mobile"] .adsocy-ad-modal-header {
    max-width: unset;
}
.adsocy-ad-modal-header-text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex: 1;
}
.adsocy-ad-modal-header-close {
    cursor: pointer;
    width: var(--headerHeight);
}
.adsocy-ad-modal-header-close svg {
    width: var(--headerHeight);
    height: var(--headerHeight);
    filter: invert(1);
    vertical-align: top;
    transform: scale(0.8);
}
.adsocy-ad-modal-header-close-disabled {
    pointer-events: none;
}
.adsocy-ad-modal-header-close-disabled svg {
    display: none;
}
.adsocy-ad-modal-header-close-counter {
    opacity: 0.6;
}
.adsocy-ad-modal-header-close:not(.adsocy-ad-modal-header-close-disabled) .adsocy-ad-modal-header-close-counter {
    display: none;
}
#adsocy-ad-modal > div {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
#adsocy-ad-modal iframe {
    width: calc((100vh - (var(--headerHeight) + var(--headerMargin)) - 20px) / 2);
    height: calc(100vh - (var(--headerHeight) + var(--headerMargin)) - 20px);
    max-width: 450px;
    max-height: 900px;
    border: none;
}
body[data-mode="mobile"] #adsocy-ad-modal iframe {
    width: 100%;
    height: 100%;
    max-width: unset;
    max-height: unset;
}
@media (max-height: 550px) {
    body:not([data-mode="mobile"]) #adsocy-ad-modal iframe {
        width: calc(100vh / 2);
        height: 100vh;
    }
}
