#ytFloatPlayer {
    display: none;
    position: fixed;
    top: 16px;
    right: 16px;
    width: 46vw;
    max-width: 680px;
    min-width: 300px;
    background: #1a1d26;
    border-radius: 14px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.7);
    z-index: 9999;
    overflow: hidden;
    flex-direction: column;
    border: 1px solid rgba(255,255,255,0.08);
}

#ytFloatPlayer.ytFloatVisible {
    display: flex;
}

#ytFloatHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #13161d;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

#ytFloatTitle {
    color: #ccc;
    font-size: 13px;
    font-family: Verdana, sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 36px);
}

#ytFloatClose {
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

#ytFloatClose:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

#ytFloatBody {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
}

#ytFloatIframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Miniatura YouTube en el chat */
.yt-thumb-wrap {
    display: inline-block;
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    vertical-align: middle;
    margin: 2px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
    transition: transform 0.15s, box-shadow 0.15s;
}

.yt-thumb-wrap:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 18px rgba(0,0,0,0.6);
}

.yt-thumb-wrap img {
    display: block;
    width: 240px;
    height: 135px;
    object-fit: cover;
}

.yt-thumb-play {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 44px; height: 44px;
    background: rgba(0,0,0,0.72);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: background 0.15s;
}

.yt-thumb-wrap:hover .yt-thumb-play {
    background: #ff0000;
}

.yt-thumb-play::after {
    content: "";
    display: block;
    width: 0; height: 0;
    border-style: solid;
    border-width: 9px 0 9px 18px;
    border-color: transparent transparent transparent #fff;
    margin-left: 3px;
}

@media screen and (max-width: 600px) {
    #ytFloatPlayer {
        width: calc(100vw - 16px);
        right: 8px;
        top: 8px;
        max-width: none;
    }
    .yt-thumb-wrap img {
        width: 180px;
        height: 101px;
    }
}
