.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    visibility: hidden;  
    opacity: 0;
    transition: visibility 0.2s, opacity 0.25s ease;
    cursor: pointer;     
}

.modal-overlay.active {
    visibility: visible;
    opacity: 1;
}
.modal-container {
    position: relative;
    width: 90%;
    max-width: 1100px; 
    background: #000;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 30px 50px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    transform: scale(0.96);
    cursor: default;       
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}
.video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 100% * 9 / 16 = 56.25% -> Ñ€Ð¾Ð²Ð½Ð¾ 16:9 */
    height: 0;
    background-color: #000;
}
.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; 
    object-fit: contain;
    background: #000;
}
.close-modal-btn {
    position: absolute;
    top: 16px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    border: none;
    color: white;
    font-size: 28px;
    font-weight: 400;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
    font-family: monospace;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.close-modal-btn:hover {
    background: rgba(220, 53, 69, 0.9);
    transform: scale(1.05);
}
.modal-hint {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    background: rgba(0,0,0,0.4);
    padding: 6px 10px;
    width: fit-content;
    margin: 0 auto;
    border-radius: 40px;
    backdrop-filter: blur(4px);
    pointer-events: none;
    font-weight: 500;
    letter-spacing: 0.3px;
}
@media (max-width: 640px) {
    .modal-container {
        width: 95%;
        border-radius: 20px;
    }
    .close-modal-btn {
        top: 10px;
        right: 12px;
        width: 38px;
        height: 38px;
        font-size: 24px;
    }
    .video-link {
        padding: 0.7rem 1.5rem;
        font-size: 1rem;
    }
    .content {
        padding: 1.5rem 1rem;
    }
    h1 {
        font-size: 1.6rem;
    }
    .modal-hint {
        font-size: 0.65rem;
        bottom: 8px;
    }
}

@media (min-height: 800px) {
    .modal-container {
        margin: 2rem auto;
    }
}
body.modal-open {
    overflow: hidden;
    padding-right: 0; 
}