@font-face {
    font-family: 'Truetypewriter';
    src: url('/wp-content/uploads/live_frontend/fonts/truetypewriter/TruetypewriterPolyglott-mELa.eot');
    src: url('/wp-content/uploads/live_frontend/fonts/truetypewriter/TruetypewriterPolyglott-mELa.eot') format('embedded-opentype'),
    url('/wp-content/uploads/live_frontend/fonts/truetypewriter/TruetypewriterPolyglott-mELa.woff') format('woff'),
    url('/wp-content/uploads/live_frontend/fonts/truetypewriter/TruetypewriterPolyglott-mELa.ttf') format('truetype');
}

#live_content {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
    width: 100%;
    text-align: center;
}

#live_content>div {
    width: 100%;
    margin-bottom: 0;
}

@media screen and (max-width: 1200px) {
    #live_content>div {
        width: 75%;
        margin-bottom: 5rem;
    }
}

@media screen and (max-width: 576px) {
    #live_content>div {
        width: 100%;
        margin-bottom: 5rem;
    }
}

#live_content>div>form {
    width: 33.33%;
    text-align: left;
}

.live_text_page {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
    width: 100%;
    text-align: center;

    .live_btn {
        margin-top: 1rem;
    }
}

.g-recaptcha-container > div {
    margin: 0 auto;
}

#live_social_login {

}

.live_social_login_button {
    width: 250px;
    height: 42px;
    border-radius: 2px;
    margin: 0 auto;
    display: flex;
    cursor: pointer;

    &:not(:first-child) {
        margin-top: 10px;
    }

    .icon-wrapper {
        margin-top: 1px;
        margin-left: 1px;
        width: 40px;
        height: 40px;
        border-radius: 2px;
    }

    .icon {
        position: absolute;
        margin-top: 11px;
        margin-left: 11px;
        width: 18px;
        height: 18px;
    }

    .btn-text {
        width: 210px;
        margin: 11px auto;
        text-align: center;
        font-size: 14px;
        letter-spacing: 0.5px;
    }
}

.live_social_login_button.google {
    background-color: #4285f4;
    box-shadow: 0 3px 4px 0 rgba(0,0,0,.25);

    .icon-wrapper { background-color:  #ffffff; }
    .btn-text { color: #ffffff; }

    &:hover  { box-shadow: 0 0 6px #4285f4; }
    &:active { background: #1669F2; }
}

.live_social_login_button.facebook {
    background-color: #4267B2;
    box-shadow: 0 3px 4px 0 rgba(0,0,0,.25);

    .icon-wrapper { background-color:  #ffffff; }
    .btn-text { color: #ffffff; }

    &:hover  { box-shadow: 0 0 6px #4267B2; }
    &:active { background: #374a72; }
}

.live_social_login_button.vk {
    background-color: #5181b8;
    box-shadow: 0 3px 4px 0 rgba(0,0,0,.25);

    .icon-wrapper { background-color:  #ffffff; }
    .btn-text { color: #ffffff; }

    &:hover  { box-shadow: 0 0 6px #5181b8; }
    &:active { background: #46688e; }
}

.live_social_login_button.x {
    background-color: #000000;
    box-shadow: 0 3px 4px 0 rgba(0,0,0,.25);

    .icon-wrapper { background-color:  #ffffff; }
    .btn-text { color: #ffffff; }

    &:hover  { box-shadow: 0 0 6px #000000; }
    &:active { background: #1a1a1a; }
}

.live_login_separator {
    line-height: 1em;
    position: relative;
    outline: 0;
    border: 0;
    color: black;
    text-align: center;
    height: 1.5em;
    opacity: .5;
    margin: 15px auto;
    &:before {
        content: '';
        background: linear-gradient(to right, transparent, #818078, transparent);
        position: absolute;
        left: 0;
        top: 50%;
        width: 100%;
        height: 1px;
    }
    &:after {
        content: attr(data-content);
        position: relative;
        display: inline-block;
        padding: 0 .5em;
        line-height: 1.5em;
        color: #818078;
        background-color: #fcfcfa;
    }
}

.live_error {
    color: #ff0000;
    font-size: .80rem;
}

.live_stream_title_error {
    color: #ff0000;
}

#live_login_form,
#live_register_form,
#live_forgot_password_form,
#live_reset_password_form {
    margin: auto;
    width: 33%;
}

.live_btn {
    background: #ffc61c;
    color: #111;
    font-size: 13px;
    text-transform: uppercase;
    font-weight: 800;
    padding: .5rem;
    border: 0;
    text-decoration: none;

    &[type="submit"] {
        display: flex;
        flex-direction: row;
        align-items: center;
    }
}

.live_btn:hover,
.live_btn:focus,
.live_btn:active {
    background: #f56328;
    color: #fff;
}

.live_btn:disabled {
    background: #ffcd55;
    color: #fff;
}

#live_login_password_block {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-top: 2rem;
    font-size: 0.80rem;
}

#live_forgot-password-link {
    color: #111;
    font-weight: bold;
    text-decoration: none;
    margin-bottom: .2rem;
}

#live_login_submit_container,
#live_register_submit_container,
#live_forgot_password_submit_container {
    margin-top: 2rem;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}


.live_loader {
    width: 100%;
    height: 4.8px;
    display: inline-block;
    position: relative;
    overflow: hidden;
}
.live_loader::after {
    content: '';
    width: 96px;
    height: 4.8px;
    background: #99bbdf;
    position: absolute;
    top: 0;
    left: 0;
    box-sizing: border-box;
    animation: hitZak 0.6s ease-in-out infinite alternate;
}

@keyframes hitZak {
    0% {
        left: 0;
        transform: translateX(-1%);
    }
    100% {
        left: 100%;
        transform: translateX(-99%);
    }
}

.live_user_settings {
    width: 100%;
    text-align: center;
}

.live_user_settings>form {
    display: flex;
    flex-direction: row;
    justify-content: end;
    align-items: center;
    margin: 0 0 1.5rem 0;

    div {
        display: flex;
        justify-content: end;
    }

    #live_home_btn {
        margin-right: auto;
    }

    button {
        margin-left: 1rem;
    }
}

#streamTemplate {
    display: block;
}

#live_no_active_streams {
    display: none;

    h1
    {
        text-align: center;
    }
}

.live_streams_container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    gap: 2rem 2rem;
    margin-bottom: 2rem;
}

.live_stream_card {
    margin: 0 1rem;
    border: 1px solid #cccccc;
    border-radius: 5px;
    width: 100%;
    max-width: 480px;
    text-align: left;
}

.live_stream_card img {
    width: 100%;
}

.live_stream_card_footer {
    margin: 0;
    padding: 0 1rem 1rem 1rem;
}

.live_thumbnail {
    position: relative;
}

.live_error_page_code,
.live_error_page_text,
.live_error_page_back_btn {
    text-align: center;
}

.yt-thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0)) rgba(0, 0, 0, 0);
    transition: all 0.2s;
    margin: 0;
    padding: 0;
}

.yt-thumbnail-overlay:hover,
.yt-thumbnail-overlay:focus {
    background: radial-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.2)) rgba(0, 0, 0, 0.2);
}

.yt-thumbnail-overlay > h2 {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translateX(-50%) translateY(-50%) rotate(-32deg);
    transition: all 0.2s;
    color: rgba(235, 235, 235, 0.7);
    margin: 0;
}

.yt-thumbnail-overlay:hover > h2,
.yt-thumbnail-overlay:focus > h2 {
    color: rgba(235, 235, 235, 1);
}

.yt-thumbnail-wrapper {
    overflow: hidden;
    padding: 0;
}

.yt-completed {
    font-family: 'Truetypewriter';
    font-size: 2.5rem;
    font-weight: 100;
}

@media screen and (max-width: 992px) {
    #live_content>div>form {
        width: 100%;
    }

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

    .live_stream_card,
    .live_finished_stream_card{
        margin: 0;
    }

    .live_finished_streams_container {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .live_user_settings>form {
        justify-content: flex-end;

        #live_home_btn span {
            display: none;
        }

        #live_greeting {
            display: none;
        }
    }
}

.live_no_uppercase_btn {
    text-transform: none;
}

.live_spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #FFF;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    margin: 0 .5rem 0 0;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* VIDEO PLAYER */

/*
 * The player's state lives in data attributes on .live_player (set by templates/show_stream.php):
 *   data-state="loading|playing|stopped", data-controls="visible|hidden",
 *   data-muted="true|false", data-fullscreen="true|false"
 */

.live_player {
    --live-player-blue: #2a70b4;
    --live-player-blue-dark: #06243b;
    --live-player-blue-light: #99bbdf;
    --live-player-radius: 10px;

    position: relative;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    isolation: isolate;
    background: #000;
    border-radius: var(--live-player-radius);
    box-shadow: 0 12px 32px rgba(6, 36, 59, .25);
    color: #fff;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.live_player:fullscreen {
    max-width: none;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    border-radius: 0;
    box-shadow: none;
}

.live_player:-webkit-full-screen {
    max-width: none;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    border-radius: 0;
    box-shadow: none;
}

.live_player[data-state="playing"][data-controls="hidden"] {
    cursor: none;
}

.live_player_video {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* Darkens the poster while stopped, so the resume button stands out */
.live_player::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(6, 36, 59, .35);
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
}

.live_player[data-state="stopped"]::after {
    opacity: 1;
}

/* ── Loader (Polytonica leaves) ── */

.live_player_loader {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    place-items: center;
    background: radial-gradient(circle, rgba(42, 112, 180, .25) 0%, rgba(6, 36, 59, .6) 100%);
    opacity: 0;
    visibility: hidden;
    transition: opacity .4s ease, visibility 0s linear .4s;
    pointer-events: none;
}

.live_player[data-state="loading"] .live_player_loader {
    opacity: 1;
    visibility: visible;
    transition: opacity .4s ease .15s, visibility 0s;
}

.live_player_loader_img {
    grid-area: 1 / 1;
    width: clamp(3rem, 8vw, 5rem);
    height: clamp(3rem, 8vw, 5rem);
}

.live_player_leaf {
    animation: live-player-grow 1s ease-in infinite;
}

.live_player_leaf:nth-child(3) {
    animation-delay: .3s;
}

.live_player_leaf:nth-child(4) {
    animation-delay: .6s;
}

@keyframes live-player-grow {
    25% {
        transform: scale(1.2);
    }
    75% {
        transform: scale(1);
    }
}

/* ── Resume button (while stopped): a plain white triangle ── */

.live_player_resume {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: clamp(64px, 10vw, 96px);
    height: clamp(64px, 10vw, 96px);
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
    color: #fff;
    cursor: pointer;
    transform: translate(-50%, -50%) scale(.85);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s, color .15s;
}

.live_player[data-state="stopped"] .live_player_resume {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
    transition: opacity .2s ease, transform .2s ease, visibility 0s, color .15s;
}

.live_player_resume:hover {
    color: var(--live-player-blue-light);
    transform: translate(-50%, -50%) scale(1.08);
}

.live_player_resume svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
    /* keeps the triangle readable on bright posters */
    filter: drop-shadow(0 2px 10px rgba(6, 36, 59, .6));
}

/* ── LIVE badge ── */

.live_player_badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px 5px 8px;
    border-radius: 999px;
    background: rgba(6, 36, 59, .6);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .08em;
    text-transform: uppercase;
    pointer-events: none;
}

.live_player_dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--live-player-blue-light);
    opacity: .6;
    transition: background-color .2s, opacity .2s;
}

.live_player[data-state="playing"] .live_player_dot {
    background: #fff;
    opacity: 1;
    animation: live-player-pulse 1.6s ease-out infinite;
}

@keyframes live-player-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, .7);
    }
    100% {
        box-shadow: 0 0 0 7px rgba(255, 255, 255, 0);
    }
}

/* ── Control bar ── */

.live_player_controls {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 36px 12px 10px;
    background: linear-gradient(to top, rgba(6, 36, 59, .85), rgba(6, 36, 59, 0));
    transition: opacity .25s ease, transform .25s ease;
}

.live_player[data-state="playing"][data-controls="hidden"] .live_player_controls {
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
}

.live_player_btn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    color: #fff;
    cursor: pointer;
    transition: background-color .15s, color .15s;
}

.live_player_btn[hidden] {
    display: none;
}

/* Only with a real mouse: touch screens keep :hover on a tapped button until the next tap elsewhere.
   data-hover="off" = just clicked - no background until the pointer leaves the button (see show_stream.php) */
@media (hover: hover) {
    .live_player_btn:not([data-hover="off"]):hover {
        background: var(--live-player-blue);
        color: #fff;
    }
}

.live_player_btn:focus-visible,
.live_player_resume:focus-visible {
    outline: 2px solid var(--live-player-blue-light);
    outline-offset: 2px;
}

.live_player_btn svg {
    display: block;
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.live_player_spacer {
    flex: 1;
}

/* ── Quality switcher ── */

.live_player_quality {
    position: relative;
}

.live_player_quality[hidden] {
    display: none;
}

.live_player .live_player_quality_btn {
    display: inline-flex;
    justify-content: center;
    gap: 6px;
    width: auto;
    padding: 0 12px 0 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.live_player_quality_btn svg {
    width: 20px;
    height: 20px;
    transition: transform .3s ease;
}

.live_player_quality_btn[aria-expanded="true"] {
    background: var(--live-player-blue);
}

.live_player_quality_btn[aria-expanded="true"] svg {
    transform: rotate(60deg);
}

.live_player_quality_menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    min-width: 150px;
    margin: 0;
    padding: 6px;
    list-style: none;
    border-radius: 10px;
    background: rgba(6, 36, 59, .94);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}

.live_player_quality_menu[hidden] {
    display: none;
}

.live_player_quality_menu li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.live_player_quality_option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 8px 12px 8px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
}

.live_player_quality_option svg {
    flex: none;
    width: 18px;
    height: 18px;
    fill: currentColor;
    visibility: hidden;
}

.live_player_quality_option[aria-checked="true"] svg {
    visibility: visible;
}

.live_player_quality_option:focus-visible {
    background: var(--live-player-blue);
    outline: none;
}

@media (hover: hover) {
    .live_player_quality_option:hover {
        background: var(--live-player-blue);
    }
}

/* Icon swapping */
.live_player .live_player_icon_play,
.live_player[data-state="stopped"] .live_player_icon_stop,
.live_player[data-muted="true"] .live_player_icon_unmuted,
.live_player[data-muted="false"] .live_player_icon_muted,
.live_player[data-fullscreen="true"] .live_player_icon_enter_fullscreen,
.live_player[data-fullscreen="false"] .live_player_icon_exit_fullscreen {
    display: none;
}

.live_player[data-state="stopped"] .live_player_icon_play {
    display: block;
}

/* ── Around the player ── */

#live_video_title {
    max-width: 1280px;
    margin: 0 auto 1rem;
    text-align: left;
}

#live_video_currently_watching {
    max-width: 1280px;
    margin: 1rem auto 0;
    font-size: .9rem;
    text-align: right;
}

#live_video_user_count {
    font-weight: 700;
}

#live_video_user_names {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .4rem;
    margin: .5rem 0 0;
    padding: 0;
}

#live_video_user_names li {
    list-style: none;
    padding: .2rem .7rem;
    border-radius: 999px;
    background: #eef3f9;
    color: #06243b;
}

@media screen and (max-width: 576px) {
    .live_player {
        --live-player-radius: 6px;
    }

    /* Only the icon on phones - the label would crowd the bar */
    .live_player .live_player_quality_btn {
        width: 40px;
        padding: 0;
    }

    .live_player_quality_label {
        display: none;
    }

    .live_player_badge {
        top: 8px;
        left: 8px;
        font-size: 11px;
    }

    .live_player_controls {
        padding: 28px 6px 4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .live_player_leaf,
    .live_player[data-state="playing"] .live_player_dot {
        animation: none;
    }
}
